package com.douyin.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("statistics_detail")
public class StatisticsDetail {
    @TableId(type = IdType.AUTO)
    private Long id;
    
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate statDate;
    private Integer statHour;  // 0-23，NULL表示全天统计
    
    // 分类维度
    private String parseSource;     // miniprogram/h5/api
    private String sourcePlatform;  // douyin/tiktok/kuaishou
    private String deviceType;      // mobile/tablet/desktop
    private String country;
    private String region;
    
    // 统计数据
    private Integer totalRequests;
    private Integer successRequests;
    private Integer failedRequests;
    private Integer avgParseTime;
    private Long totalFileSize;
    
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;
    
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;
}